package com.chapter4.superprivatefinal.demo2;


/**
 * 继承
 */
public class Animal {
    private int  height,weight;

    public Animal(int height, int weight) {
        //在类中可以直接使用私有成员变量
        this.height = height;
        this.weight = weight;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public void eat(){
        System.out.println("Animal eat");
    }

    public void sleep(){
        System.out.println("Animal sleep");
    }

    public void breathe(){
        System.out.println("Animal breathe");
    }
}
